﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Candidats.aspx.cs" Inherits="ETestIT.UI.Candidats" Title="Untitled Page" %>

<%@ Register TagPrefix="uc" TagName="CandidateAddEdit" Src="~\AppControls\CandidateAddEdit.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2 id="PageTitle"><%= Title %></h2>
    <asp:LinkButton ID="addNewCandidate" Text="add new" runat="server" OnClick="BtnAddNewCandidate_Clicked" />
    <br/><br/>
    <div>
        <asp:GridView ID="gvCandidats" runat="server" AutoGenerateColumns="False" CssClass="easygrid" >
            <Columns>
               <asp:TemplateField HeaderText = "Name" ControlStyle-Width="100px">
                    <ItemTemplate>
                        <asp:Label 
                        ID="lblFirstName" 
                        runat="server" 
                        Text='<%# string.Format("{0} {1}", Eval("FirstName"), Eval("Surename")) %>' />
                    </ItemTemplate>
               </asp:TemplateField>
               
               <asp:BoundField DataField="Title" HeaderText="Title"/>
               <asp:TemplateField HeaderText = "Resumes">
                    <ItemTemplate>
                        <asp:LinkButton 
                                ID="lbtnCandidateResume" 
                                runat="server" 
                                Text="View"
                                CommandName="ViewCandidateResume" 
                                CommandArgument='<%#Eval("Id")%>' 
                                OnCommand="LnkEditCommand"/>
                    </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField HeaderText = "Actions">
                    <ItemTemplate>
                        <asp:LinkButton 
                                ID="lbtnEditUser" 
                                runat="server" 
                                Text="Edit"
                                CommandName="CandidatsEdit" 
                                CommandArgument='<%#Eval("Id")%>' 
                                OnCommand="LnkEditCommand"/>
                        <asp:LinkButton 
                                ID="lbtnDeleteUser" 
                                runat="server" 
                                Text="Delete"
                                CommandName="CandidatsDelete" 
                                CommandArgument='<%#Eval("Id")%>' 
                                OnCommand="LnkEditCommand"/>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    
    <div>
        <uc:CandidateAddEdit runat="server" ID = "candidateAddEdit" Visible="false" />
    </div>
</asp:Content>


